import { Define, EntityObjectFactory } from "tiny-entity2";
import { FoodDeliveryOrderItem } from "./foodDeliveryOrderItem";
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: 'fooddeliveryorder' })
export class FoodDeliveryOrder extends EntityObjectType<FoodDeliveryOrder>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    operatorId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    operatorName: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    status: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    storeId: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    version: number;

    @Define.Mapping({
        Mapping: 'FoodDeliveryOrderItem',
        MappingKey: 'foodDeliveryOrderId'
    })
    foodDeliveryOrderItems: FoodDeliveryOrderItem[];
}